package com.peenongsaban.freelance.utils;


import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionContext;

public class SessionUtils {

	public static void setSession(String key,Object value){
		 
		ActionContext context = ActionContext.getContext();
		context.getSession().put(key,value);
	}
	
	public static Object getSession(String key){
		 HttpSession session=ServletActionContext.getRequest().getSession(false);  
	        if(session==null || session.getAttribute(key)==null){  
	            return null;  
	        }  
	        else{  
	            return session.getAttribute(key);  
	        }  		
	}
	
	public static void removeSession(String key){
		 
		ActionContext context = ActionContext.getContext();
		context.getSession().remove(key);
	}
}
